/**
 *@author Ming
 *@version 12/04/2012
 *Modifications: remove temporary field of player and the related get/set functions
 //*********************************************/

package accident;
import player.*;

/**
 Accident Controller
 */
public class AccidentController {

	
	private Player player;
	
	public AccidentController(Player player){
		this.player = player;
	}
	
	/**
	 to calculate the subtracted SE value
	 */
	public void subtractSEPoints() {
	
		 int newSEPoints = player.getSEPoint() - 5;
		 if (newSEPoints < 0)
			 player.setSEPoint(0);
		 else
			 player.setSEPoint(newSEPoints);
		 
		 AccidentWindow accidentWindow = new AccidentWindow(player);
		 accidentWindow.result();
	}

}
